package com.sysmanagment.manager.user;

import java.util.List;

import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;

import com.sysmanagment.dao.user.RoleDAO;
import com.sysmanagment.dao.user.UserDAO;
import com.sysmanagment.model.user.Role;
import com.sysmanagment.model.user.User;

@Name(value="userManager")
public class UserManagerImpl implements UserManager {

	@In(value="userDAO",create=true)
	UserDAO userDAO;
	
	@In(value="roleDAO",create=true)
	RoleDAO roleDAO;
	
	@Override
	public void saveUser(User user) {
		user.setEnabled(true);
			userDAO.persist(user);
	}

	@Override
	public List<Role> getAllRoles() {
		return roleDAO.getAllRoles();
	}
	
	

}
